package com.gzq.controller;

import com.gzq.entity.User;
import com.gzq.service.UserService;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.websocket.server.PathParam;

/**
 * @description:
 * @author: duzi55
 * @date: 2019-07-01 09:11
 */
@RestController
@RequestMapping("/user")
public class UserController {
    @Resource
    UserService userService;
    @RequestMapping("/login")
    private boolean login(User user, HttpServletRequest request){
       return userService.login(user,request);
    }
    @RequestMapping("/findbyname/{rname}")
    private boolean findByName(@PathVariable("rname") String name){

        return userService.findByName(name);
    }
    @RequestMapping("/regist")
    private boolean regist(User user){
        return userService.regist(user);
    }
}
